
#ifndef __USERMGR_H__
#define __USERMGR_H__




#include <vector>
#ifdef WIN32
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;

#else
#include "stdint.h"
#endif

#include <string>
#include <algorithm>
#include <map>
typedef std::map<std::string, std::string> SSMAP;
struct MsgInfo{
    uint32_t msgType;
    SSMAP info;
};

class ServerConn;
class User;
struct MsgInfo;

class UserMgr
{
    std::vector< ServerConn* > _conns;
    User *_usr;

public:

    static UserMgr* inst;
    static UserMgr* Inst();

    void sendMsg( uint32_t connID , MsgInfo* rsp);

    void unregConn( ServerConn* conn);
    int regConn( ServerConn* conn);

	uint32_t onMsgReq(MsgInfo *msg,uint32_t connID);

	UserMgr();
	virtual ~UserMgr();
private:
};

static void response(uint32_t connID, MsgInfo* rsp){ UserMgr::Inst()->sendMsg(connID,rsp); }
#endif /* __USERMGR_H__ */
